<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="example"></div>
  </body>
  <script>
    const wm = new WeakMap();

    let element = document.getElementById("example");

    wm.set(element, "some information");
    console.log(wm.get(element)); // "some information"
    element = null;
    console.log(wm.get(element));
  </script>
</html>
